﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WaterPoint : MonoBehaviour
{
    Vector3 position;
    // Start is called before the first frame update
    void Start()
    {
        position = transform.localPosition;
    }

    public void ResetPosition(float z)
    {
        float tan = Mathf.Atan(z);
        float y;
        if (z > 180)
            y = transform.localPosition.x * (360 - z) * -0.005f;
        else
            y = transform.localPosition.x * z * 0.005f;


        transform.localPosition = new Vector3(position.x, position.y - y, position.z);
    }

    // Update is called once per frame
    void Update()
    {
    }
}
